package com.ym.core.exception;


import com.ym.common.constant.Coder;

/**
 * 自定义异常
 *
 * @author bird
 */
public class BusinessException extends RuntimeException {
	private static final long serialVersionUID = 1L;

	private String code;

	private String message;


	public BusinessException(Coder coder) {
		this.code = coder.getCode();
		this.message = coder.getMsg();
	}


	public BusinessException(String msg) {
		this.code = Coder.System.BUSINESS_ERROR.getCode();
		this.message = msg;
	}

	@Override
	public String getMessage() {
		return message;
	}

	public String getCode() {
		return code;
	}
}
